<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../lib/layui-v/css/layui.css" media="all">
    <link rel="stylesheet" href="../../css/public.css" media="all">
    <script src="/static/layuimini/js/jquery.min.js"></script>
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<div class="layui-form layuimini-form">
    <div class="layui-form-item" style="display:none;">
        <label class="layui-form-label required">ID</label>
        <div class="layui-input-block">
            <input type="text" id="id" name="id"
                   value="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">年份</label>
        <div class="layui-input-block">
            <input type="text" id="nianFen" name="nianFen" lay-verify="required"   lay-reqtext="年份不能为空"
                   value="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">行号</label>
        <div class="layui-input-block">
            <input type="number" id="hangHao" name="hangHao" lay-verify="required"   lay-reqtext="行号不能为空"
                   value="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">账户所属</label>
        <div class="layui-input-inline">
            <select name="belongToAccount"  id="belongToAccount">
                <option disabled>请选择一个账户</option>
                <!--                <option value="">全部</option>&ndash;&gt;-->
                <!--                                    <option value="010">北京</option>-->
                <!--                                    <option value="021">上海</option>-->
                <!--                                    <option value="0571">杭州</option>-->
            </select>
        </div>

    </div>
    <!--    <div class="layui-form-item">-->
    <!--        <label class="layui-form-label required">所属账户</label>-->
    <!--        <div class="layui-input-block">-->
    <!--            <input type="text" id="belongToAccount" name="belongToAccount" lay-verify="required"   lay-reqtext="所属账户不能为空"-->
    <!--                   value="" class="layui-input">-->
    <!--        </div>-->
    <!--    </div>-->

    <div class="layui-form-item">
        <label class="layui-form-label required">品种（系）名称杂交组合</label>
        <div class="layui-input-block">
            <input type="text" id="zhongMing" name="zhongMing"    value="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">耕地与征地</label>
        <div class="layui-input-block">
            <input type="text" id="gengDiZhengDi" name="gengDiZhengDi"   value=""
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">来源</label>
        <div class="layui-input-block">
            <input type="text" id="laiYuan" name="laiYuan"  value="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">长度</label>
        <div class="layui-input-block">
            <input type="text" id="changDu" name="changDu"   value="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">比强</label>
        <div class="layui-input-block">
            <input type="text" id="biQiang" name="biQiang"   value="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">马值</label>
        <div class="layui-input-block">
            <input type="text" id="maZhi" name="maZhi"   value="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">铃重</label>
        <div class="layui-input-block">
            <input type="text" id="lingZhong" name="lingZhong"   value=""
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">衣分</label>
        <div class="layui-input-block">
            <input type="text" id="yiFen" name="yiFen"   value=""
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">出苗期</label>
        <div class="layui-input-block">
            <input type="text" id="chuMiaoQi" name="chuMiaoQi"   value=""
                     class="layui-input my_class_name" placeholder="yyyy-MM-dd">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">开花期</label>
        <div class="layui-input-block">
            <input type="text" id="kaiHuaQi" name="kaiHuaQi"   value=""
                     class="layui-input my_class_name" placeholder="yyyy-MM-dd">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">吐絮期</label>
        <div class="layui-input-block">
            <input type="text" id="tuXuQi" name="tuXuQi"   value=""
                     class="layui-input my_class_name" placeholder="yyyy-MM-dd">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">生长势--苗期</label>
        <div class="layui-input-block">
            <input type="text" id="szsMiaoQi" name="szsMiaoQi"   value="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">生长势--花期</label>
        <div class="layui-input-block">
            <input type="text" id="szsHuaQi" name="szsHuaQi"   value=""
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">整齐度--苗期</label>
        <div class="layui-input-block">
            <input type="text" id="zqdMiaoQi" name="zqdMiaoQi"   value=""
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">整齐度--花期</label>
        <div class="layui-input-block">
            <input type="text" id="zqdHuaQi" name="zqdHuaQi"   value=""
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">收获株数</label>
        <div class="layui-input-block">
            <input type="number" id="收获株数" name="收获株数"   value=""
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">主要特征特性--株型</label>
        <div class="layui-input-block">
            <input type="text" id="zytxZhuXing" name="zytxZhuXing"   value=""
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">主要特征特性--叶型</label>
        <div class="layui-input-block">
            <input type="text" id="zytxYeXing" name="zytxYeXing"   value=""
                   class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label required">主要特征特性--铃型</label>
        <div class="layui-input-block">
            <input type="text" id="zytxLingXing" name="zytxLingXing"   value=""
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">主要特征特性--株高</label>
        <div class="layui-input-block">
            <input type="text" id="zytxZhuGao" name="zytxZhuGao"   value=""
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">主要特征特性--结铃性</label>
        <div class="layui-input-block">
            <input type="text" id="zytxJieLingXing" name="zytxJieLingXing"   value=""
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">主要特征特性--叶絮性</label>
        <div class="layui-input-block">
            <input type="text" id="zytxYeXuXing" name="zytxYeXuXing"   value=""
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">抗病性--枯萎病指</label>
        <div class="layui-input-block">
            <input type="text" id="kuWeiBingZhi" name="kuWeiBingZhi"   value=""
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">抗病性--黄萎病指</label>
        <div class="layui-input-block">
            <input type="text" id="huangWeiBingZhi" name="huangWeiBingZhi"   value=""
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">田间决选</label>
        <div class="layui-input-block">
            <input type="text" id="tianJianJueXuan" name="tianJianJueXuan"   value=""
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">备注</label>
        <div class="layui-input-block">
            <input type="text" id="mark" name="mark"   value=""
                   class="layui-input">
        </div>
    </div>


    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
        </div>
    </div>
</div>





<script src="../../lib/layui-v/layui.js" charset="utf-8"></script>
<script>

    layui.use(['form','laydate'], function () {
        var form = layui.form,
            layer = layui.layer,
            laydate = layui.laydate,
            $ = layui.$;

        //日期
        $('.my_class_name').each(function() {
            laydate.render({
                elem: this       //使用this指向当前元素,不能使用class名, 否则只有第一个有效
            });
        })

        //监听提交
        form.on('submit(saveBtn)', function (data) {
            $.ajax({
                url: '/tZpcjsjs/update',
                data: JSON.stringify(data.field),
                contentType: "application/json;charset=utf-8",
                dataType: 'json',
                type: "post",
                async: false,//false为同步，这个Ajax请求将整个浏览器锁死
                success: function (d) {
                    if (d.msg == 1) {
                        layer.msg("修改成功", {icon: 6});
                        window.parent.location.reload();//修改成功后刷新父界面
                    } else {
                        layer.msg("修改失败", {icon: 5});
                    }
                }
            })
            var iframeIndex = parent.layer.getFrameIndex(window.name);
            parent.layer.close(iframeIndex);
            return false;
        });

    });
    $(document).ready(function () {
        $.ajax({
            type:"get",
            url:'/tTeams/myselect',
            success:function(userList){
                if (userList.msg==1){
                    // console.log(userList.data);
                    // alert(userList.data[3].custIndustry);
                    // alert(userList.data.length);

                    if(userList.data!=null){ //后台传回来的select选项
                        for(var i=0;i<userList.data.length;i++){
                            $("#belongToAccount").append("<option value='" + userList.data[i].username + "'>" + userList.data[i].username + "</option>");
                        }
                        layui.use('form', function () {
                            var form = layui.form;
                            form.render();
                        });
                    }
                }
            }
        })
    })
</script>
</body>
</html>